var http = require('http');
var resultMap = {};
var nodegrass = require('nodegrass');
var urllist = [
'http://l.tbcdn.cn/apps/malldetail/4.0b/base.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/detail.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/mui.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/bid/bid.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/cart/cart.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/cart/cart.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/combos/combos.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/combos/combos.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/common/crossDomain.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/common/hubble.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/common/loader.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/common/tbskip.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/common/util.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/control/carmodelselector.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/control/carmodelselector.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/css/auction.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/css/detail.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/css/noPermission.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/css/overlay.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/css/shop.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/css/spriter.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/data/ajax.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/data/data.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/dc/dc.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/external/calculateResult.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/external/sizeCalculator.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/external/xCrossIframe.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/foot/foot.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/meiz/meiz.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/meiz/meiz.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/model/product.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/atp.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/attributes.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/attributes.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/eventroute.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/feedback.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/flashplayer.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/focusTime.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/init.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/ishare.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/itemDesc.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/lazy.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/leftSlide.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/mainBody.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/other.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/relate.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/relate.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/staticMods.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/other/test.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/recommend/a.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/recommend/a.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/recommend/basketrecommend.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/recommend/basketrecommend.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/recommend/common.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/recommend/waterfall.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/recommend/waterfall.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/shop/shop.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/3c.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/areaSeletor.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/areaSell.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/basketAnim.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/buylink.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/calculator.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/codeexchange.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/common.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/countdown.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/double11.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/editEntry.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/fastlogin.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/freight.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/ifclocation.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/jia.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/linkbasket.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/paymethods.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/popupsimulate.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/price.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/promotion.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/propertyHandler.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/regionSelectPopup.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/regionSell.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/sellCount.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/service.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/setup.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/shiptime.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/skuAmount.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/skuFeatureIcon.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/skuLade.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/skuMsg.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/skuTmVip.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/stat.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/stock.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/thumbViewer.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/util.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/validator.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/wanrentuan.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/sku/wanrentuan.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/spu/spu.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/tabbar/AfterSales.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/tabbar/Attrs.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/tabbar/DealRecord.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/tabbar/SellerInfo.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/tabbar/localData.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/tabbar/newRecommend.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/tabbar/reviewsTmall.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/tabbar/tabbar.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/tabbar/tabbar.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/tabbar/tabbarAttr.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/tabbar/try.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/tabbar/try.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/util/timer.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/control/area/area.css' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/control/area/dataFull.js' ,
'http://l.tbcdn.cn/apps/malldetail/4.0b/control/area/dataLite.js'
               ];
var backCount = 0;
for(var i = 0; i < urllist.length; i++){
	new function(){
		var address = urllist[i];
		resultMap[address] = 'waited';
		console.log('waited: ' + address)
		
		http.get(address,function(res){
                        var status = res.statusCode;
                        
                        res.on('data',function(chunk){
                                
                        });
                        res.on('end',function(){
                        	resultMap[address] = '	backed		' + status + '		' + new Date()
                			console.log('back: ' + address)
                			backCount++;
                        	if(backCount == urllist.length){
                        		process.exit(0);
                        	}
                        });
		});
		
	}()
}



http.createServer(function(req, res){
	for(var key in resultMap){
		res.write(key + ':' + resultMap[key] + '\n');
	}
	res.end()
}).listen(10000, '127.0.0.1');